var pageSize = 10;
$(document).ready(function(){
	var Id=$('#Id').val();
	selectTransfer(Id)
});
//查询转诊
function selectTransfer(Id){
	$.getApiClient('/transfer/selectList/{id}').setQuery({id:Id}).get().done(function(data){
		if(data.code == "0"){
			var sexFlag;
			if(data.payload.sex=='1'){
				sexFlag="男";
			}else if(data.payload.sex=='2'){
				sexFlag="女";
			}
			if(data.payload.transfer_type=='2'){
				var pt="患者姓名"+data.payload.patient_name+"性别"+sexFlag+" 年龄"+data.payload.age+"  档案编号";
				pt=pt+"<br/>"+"家庭住址:"+data.payload.addr+"	手机:"+data.payload.phone;
				pt=pt+"<br/>"+"因病情需要，转入 "+data.payload.hospital_name+" 单位的 "+data.payload.department_name+" 科室 "+data.payload.user_name+"接诊医生";
				$("#content").html(pt);
				var tm=data.payload.hospital_name+"(机构名称)"+"<br/>";
				tm=tm+"现有患者"+data.payload.patient_name+"  性别 "+sexFlag+"  年龄 "+data.payload.age;
				tm=tm+"<br/>"+" 因病情需要，需转入贵单位，请予以接诊";
				tm=tm+"<br/>"+"初步印象:诊断";
				var history_now=data.payload.history_now==null?"未填写  ":data.payload.history_now;
				tm=tm+"<br/>"+"主要现病史(转出原因)"+history_now;
				var history_past=data.payload.history_past==null?"未填写  ":data.payload.history_past;
				tm=tm+"<br/>"+"主要既往史"+history_past;
				var treatment_process=data.payload.treatment_process==null?"未填写  ":data.payload.treatment_process;
				tm=tm+"<br/>"+"治疗经过"+treatment_process;
				$("#content1").html(tm+"<br/><br/>");
			}else if(data.payload.transfer_type=='3'){
				var pt="患者姓名"+data.payload.patient_name+"性别"+sexFlag+" 年龄"+data.payload.age+"  档案编号";
				pt=pt+"<br/>"+"家庭住址:"+data.payload.addr+"	手机:"+data.payload.phone;
				pt=pt+"因病情需要，转回 "+data.payload.hospital_name+" 单位";
				$("#content").html(pt);
				var tm=data.payload.hospital_name+"(机构名称)";
				tm=tm+"现有患者"+data.payload.patient_name+"因病情需要，现转回该单位，请予以接诊。";
				tm=tm+"住院病案号";
				var preliminary_diagnosis=data.payload.preliminary_diagnosis==null?"未填写  ":data.payload.preliminary_diagnosis;
				tm=tm+"诊断结果"+preliminary_diagnosis;
				var preliminary_diagnosis=data.payload.preliminary_diagnosis==null?"未填写  ":data.payload.preliminary_diagnosis;
				tm=tm+"主要检查结果"+preliminary_diagnosis;
				tm=tm+"治疗经过及下一步治疗方案及康复建议";
				$("#content1").html(tm);
			}
		}
	});
}
